'use strict';
var calculate_average = function(collection){

    let arr = collection.filter(function(x){
        if(collection.indexOf(x)%2!=0) 
            return x;
    })
    let sum = arr.reduce(
        (a,b) => a+b
    )
    let average = sum / arr.length;
    return average;
};
module.exports = calculate_average;
